<?php
// +----------------------------------------------------------------------
// | Author: yaoyihong <510974211@qq.com>
// +----------------------------------------------------------------------

namespace app\api\logic;

use app\common\logic\LogicBase;
use \tpfcore\Core;
use think\Validate;

class Notice extends ApiBase
{
    public function getNotice($data = [])
    {
        $limit = isset($data['limit']) && !empty($data['limit']) ? (int)$data['limit'] : 1;

        $key = isset($data['key']) && !empty($data['key'])?$data['key']:"";

        $list = self::getList(
            [
                'where' => ["display"=>1,"key"=>$key],
                'order' => 'datetime asc',
                'paginate' => ['rows' => $limit, 'config' => ['query' => request()->param()]],
            ]
        );

        return [0, 'success', $list];
    }
}